<template>
    <div class="content">
        <el-dialog :visible.sync="moreMsg.dialogFormVisible" title="" size="tiny" :before-close="handleClose" > 
            <div v-loading = loading>
                <div class="title">更多信息</div>
                    <div class="table">
                        <table class="dialogTable" align="center">
                            <tr>
                                <td class="cl-text">负责人姓名</td>
                                <td>{{form.agentName || '--'}}</td>
                                <td class="cl-text">手机号</td>
                                <td>{{form.phone || '--'}}</td>
                            </tr>
                            <tr>
                                <td class="cl-text">结算总金额</td>
                                <td class="cl-mony">{{form.money | moneySwitch}}</td>
                                <td class="cl-text">结算区间</td>
                                <td v-if="form.intervalEndTime">{{form.intervalStartTime}}~{{form.intervalEndTime}}</td>
                                <td v-else>--</td>
                            </tr>
                        </table>
                        <div class="mr"></div>
                        <table class="dialogTable" align="center" v-if="Object.is(form.status,'已驳回')">
                            <tr>
                                <td class="cl-text">结算结果</td>
                                <td colspan="3">{{form.status || '--'}}</td>
                               
                            </tr>
                            <tr>
                                <td class="cl-text">处理人</td>
                                <td>{{form.checkor || '--'}}</td>
                                <td class="cl-text">处理时间</td>
                                <td>{{form.time.substr(0, form.time.length - 2) || '--'}}</td>
                            </tr>
                            <tr>
                                <td class="cl-text">原因</td>
                                <td colspan="3">{{form.reject || '--'}}</td>
                                
                            </tr>
                        </table>
                    </div>
                <div class="mr"></div>
                <div class="title">经销区域</div>
                <el-table :data="tableData" border style="width: 100%" v-loading="tableloading">
                    <el-table-column prop="provinceName" align="center" label="经销省" width="180">
                      <template scope="scope">
                        {{scope.row.provinceName || '--'}}
                      </template>
                    </el-table-column>
                    <el-table-column prop="cityName" align="center" label="经销市" width="180">
                      <template scope="scope">
                        {{scope.row.cityName || '--'}}
                      </template>
                    </el-table-column>
                    <el-table-column prop="areaName" align="center" label="经销区">
                      <template scope="scope">
                        {{scope.row.areaName || '--'}}
                      </template>
                    </el-table-column>
                </el-table>
                <div class="mr"></div>
                <footer>
                    <el-button @click="handleClose">关闭</el-button>
                </footer>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import { getSettlementAgentData, listAgentProvinces } from 'api/settlemain';
export default {
  // name: "moreInfor",
    props: {
        moreMsg: {}
    },
    created() {
        this.seach();
    },
    data() {
        return {
            loading: false,
            tableloading: false,
            form: {},
            tableData: []
        };
    },
    methods: {
        handleClose() {
            this.moreMsg.dialogFormVisible = false;
        },
        seach() {
            this.loading = true;
            getSettlementAgentData(this.moreMsg.state, this.moreMsg.orgUserId, this.moreMsg.id)
        .then(data => {
            this.loading = false;
            if (data.data.content) {
                this.form = data.data.content;
            }
        })
        .then(() => {
            this.tableloading = true;
            listAgentProvinces(this.moreMsg.orgUserId)
            .then(data => {
                this.tableloading = false;
                this.tableData = data.data.content;
            })
            .catch(Error => {
                this.tableloading = false;
            });
        })
        .catch(Error => {
            this.loading = false;
        });
        },
        getTable() {},
        add() {
            console.log('成功！');
            this.$emit('sortInfor', value);
            this.moreMsg.dialogFormVisible = false;
        }
    }
};
</script>
<style lang="scss" scoped>
section,
footer {
  text-align: center;
}
.mr {
  margin-bottom: 30px;
}
.title {
  position: relative;
  margin-bottom: 30px;
  font-size: 14px;
  padding-left: 20px;
  &::after {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 4px;
    height: 14px;
    background: #ff5e2c;
  }
}
section {
  padding-bottom: 50px;
  el-button {
    margin-right: 20px;
  }
}
.cl-text {
  color: #000;
}
.dialogTable {
  text-align: center;
  //   margin: 30px auto;
  th,
  td {
    padding: 0 20px;
    text-align: center;
    border: solid 1px #ececec;
    height: 40px;
  }
  .cl-right {
    border-right: solid 1px transparent;
  }
  tr td:nth-of-type(1) {
    width: 120px;
  }
  tr td:nth-of-type(2) {
    width: 120px;
    text-align: left;
    // overflow: hidden; /*超出部分隐藏*/
    // white-space: nowrap; /*不换行*/
    // text-overflow: ellipsis; /*超出部分文字以...显示*/
  }
  tr td:nth-of-type(3) {
    width: 100px;
  }
  tr td:nth-of-type(4) {
    width: 210px;
    padding: 0 10px;
  }
}
.cl-mony {
  color: #ff6600;
}
</style>
